import java.util.Arrays;
import java.util.List;

import static java.util.stream.Collectors.toList;

public class TestBookStream {
    public static void main(String[] args) {
        List<Book> books= Arrays.asList(
                new Book("《美好》",50),
                new Book("《明天》",120),
                new Book("《你好》",130),
                new Book("《你们》",90),
                new Book("《你的她》",56));
        List<String> BookStream=books.stream()
                .filter(d->d.getPrice()>100)
                .sorted((d1,d2)->d1.getPrice()-d2.getPrice())
                .map(d->d.getName())
                .collect(toList());

        System.out.println("There are those with prices greater than 100:");
        for(String name:BookStream)
            System.out.println(name);
    }
}
